﻿using MS.Entities;
using MS.Enums.Common;
using MS.Utility.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MS.DataAccess
{
    public partial class MS_Base_UserRoleDataAccess
    {
        /// <summary>
        /// 用户角色表-批量增加方法
        /// </summary>
        public void AddRange(List<MS_Base_UserRole> list)
        {
            using (MSDbContext context = new MSDbContext(WriteRead.Write))
            {
                context.MS_Base_UserRole.AddRange(list);
                context.SaveChanges();
            }
            foreach (MS_Base_UserRole ms_Base_UserRole in list)
            {
                LogHelper.AddOperate("Id = " + ms_Base_UserRole.Id, ms_Base_UserRole);
            }
        }
    }
}
